$(window).load(function(){
     var bannerH = $(".main_image li img").height();
    $("#btn_prev,#btn_next").css({"marginTop": bannerH/2-30})
    //$(".main_visual").css({height:bannerH});
     $(".main_visual").hover(function(){
     $("#btn_prev,#btn_next").fadeIn()

     },function(){
     $("#btn_prev,#btn_next").fadeOut()
     });
});

$(document).ready(function(){
    $dragBln = false;
    $(".main_image").touchSlider({
        flexible : true,
        speed : 200,
        btn_prev : $("#btn_prev"),
        btn_next : $("#btn_next"),
        paging : $(".flicking_con a"),
        counter : function (e){
            $(".flicking_con a").removeClass("on").eq(e.current-1).addClass("on");
        }
    });
    $(".main_image").bind("mousedown", function() {
        $dragBln = false;
    });
    $(".main_image").bind("dragstart", function() {
        $dragBln = true;
    });
    $(".main_image a").click(function(){
        if($dragBln) {
            return false;
        }
    });
    timer = setInterval(function(){
        $("#btn_next").click();
    }, 3000);
    $(".main_visual").hover(function(){
        clearInterval(timer);
    },function(){
        timer = setInterval(function(){
            $("#btn_next").click();
        },5000);
    });
    $(".main_image").bind("touchstart",function(){
        clearInterval(timer);
    }).bind("touchend", function(){
        timer = setInterval(function(){
            $("#btn_next").click();
        }, 5000);
    });
    /*$(window).resize(function(){
        var bannerH = $(".main_image li img").height();
        $(".main_visual,.main_image ul").css({height:bannerH});
        $("#btn_prev,#btn_next").css({"marginTop": bannerH/2-30})
    });*/
});
